class Content {
  final Map<String, dynamic> _data;

  Content(String type, [Map<String, dynamic>? otherAttributes])
      : _data = {'type': type} {
    if (otherAttributes != null) {
      _data.addAll(otherAttributes);
    }
  }

  // 提供一个方法来获取整个Map
  Map<String, dynamic> get data => _data;

  // 提供一个方法来添加或更新属性
  void setProperty(String key, dynamic value) {
    _data[key] = value;
  }

  // 提供一个方法来获取属性
  dynamic getProperty(String key) {
    return _data[key];
  }
}

class MessageContent {
  String messageId;
  String fromId;
  Content content;
  String date;

  // 构造函数
  MessageContent(
      {required this.messageId,
      required this.fromId,
      required this.content,
      required this.date});
}
